package com.itheima.filter;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/*@Slf4j
@WebFilter("/*")  //设置拦截路径， /*代表拦截所有
public class DemoFilter implements Filter {
    *//**
     * 初始化方法，只会在第一次启动程序的时候触发，只会执行一次
     * @param filterConfig
     * @throws ServletException
     *//*
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        log.info("init.......");
    }

    *//**
     * 拦截请求，逻辑处理方法，每次拦截到请求都会触发该方法
     * @param servletRequest
     * @param servletResponse
     * @param filterChain
     * @throws IOException
     * @throws ServletException
     *//*
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        log.info("doFilter......放行前逻辑*******");
        filterChain.doFilter(servletRequest,servletResponse);
        log.info("doFilter......放行后逻辑");
    }

    *//**
     * 只有在程序正常关闭的情况下才会生效
     *//*
    @Override
    public void destroy() {
        log.info("destroy.......");
    }
}*/
